import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
declare var $: any;
import { LoginService } from '../../service/loginService';
import { Router } from '@angular/router';
@Component({
  selector: 'app-header',
  templateUrl: './header.html',
  styleUrls: ['./header.css']
})
export class HeaderComponent implements OnInit {
  constructor(private route: ActivatedRoute, private loginService: LoginService, private router: Router ) {

  }
  ngOnInit() {

  }
  changemenu() {
    $('body').toggleClass('sidenav-toggled');
  }

  logout() {
    this.loginService.logout().subscribe(() => {
      this.loginService.user = null;
      this.router.navigate(['/login']);
    })
  }
  updatepsw() {
    this.router.navigate(['/updatepsw']);
  }
}
